// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  app: {
    head: {
      script: [],
      viewport: 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no',
      title: '犀牛百宝箱',
      meta: [
          { name: 'keywords', content: '犀牛百宝箱' },
          { name: 'description', content: '犀牛百宝箱！' }
      ],
      link: [
          { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
      ]
    },
  },
  devtools: { enabled: false },
  runtimeConfig: {
    public: {
      apiBase: "/userapi",
      globalTitle: "犀牛百宝箱",
    },
  },
  nitro: {
    devProxy: {
      "/userapi": {
        target: "http://api.xiniubbx.com/userapi",
        changeOrigin: true,
      },
    },
    routeRules: {
      "/userapi/**": {
        proxy: "http://api.xiniubbx.com/userapi/**",
      },
    },
  },
  modules: ["@element-plus/nuxt"],
  css: [
    "@/assets/css/main.scss",
    "element-plus/dist/index.css",
    "element-plus/theme-chalk/display.css",
    "@/assets/css/normalize.css",
    "@/assets/css/element.scss",
  ],
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: '@use "@/assets/css/_vars.scss" as *;',
        },
      },
    },
  },
});
